package problems.solved;

import java.util.ArrayList;
import java.util.List;

import utils.Utils;


public class Problem5 {
	public static void main(String[] args) {
		List<Long> primes = new ArrayList<Long>();
		for (int i = 1; i <= 20; i++) {
			final List<Long> primeFactors = Utils.primeFactors(i);
			for (Long p : primes){ 
				primeFactors.remove(p);
			}
			primes.addAll(primeFactors);
		}
		System.out.printf("Product of %s is %d%n", primes, Utils.product(primes)); //232792560
	}
}
